package com.uzai.common.enums;

/**
 * @author: cen
 * @Date: 2022-6-28 16:02:06
 * @Description: cms页面类型
 */
public enum CmsPageTypeEnum {

    /**
     * 首页
     */
    INDEX(0,"首页"),

    /**
     * 个人中心我的
     */
    USER_INFO(1,"个人中心");

    public static final int INDEX_VALUE = 0;
    public static final int USER_INFO_VALUE = 1;

    private Integer id;
    private String desc;

    CmsPageTypeEnum(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static CmsPageTypeEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (CmsPageTypeEnum type: CmsPageTypeEnum.values()) {
            if (type.getId().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
